using System;
using Kaiser.Configuration;

namespace Kaiser.Configuration.Extensions
{
    public static class ModuleConfigurationElementExtensions
    {
        public static ModuleConfigurationElement Module(this ModuleConfigurationElementCollection modules, Type moduleType)
        {
            foreach (ModuleConfigurationElement element in modules)
                if (element.Type.StartsWith(moduleType.FullName))
                    return element;

            return null;
        }
    }
}